model {										
	for (j in 1:N) {
		for (l in 1:L){
			mdl[j,l,1] <- lambda[l,1] * phi[mrg.it[j],1] 
			mdl[j,l,2] <- lambda[l,1] * phi[mrg.it[j],1]  + lambda[l,2] * phi[mrg.it[j],2]
			mrg.y[j,l] ~ dnorm(mdl[j,l,k[j]], sigma[l,k[j]])
			}
		k[j] ~ dcat(K[mrg.ce[j],1:2])
		}
	
	for(j in 1:phi.IT){
			phi[j,1:2] ~ dmnorm(phi[phi.z[j],1:2], sigmainv0[1:2,1:2,phi.w[j]])
		}

	for(l in 1:L) {
		lambda[l,1:2] ~ dmnorm(l0, L0)
		for(i in 1:2){
			sigma[l,i] ~ dgamma(e0, f0)
			}
		}

	for(ce in 1:CE){
		K[ce,1:2] ~ ddirch(d[])
		}

}